package com.example.demo1.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class usercontroller {
    @Autowired
    private com.example.demo1.service.userservice userservice;
    @RequestMapping(value = "/login",method = RequestMethod.POST)
//    @ResponseBody
    public String login(@RequestParam String username,@RequestParam String passwd){
        Boolean loginjudge = userservice.loginjudge(username, passwd);
        if (loginjudge){
            return "/index1.jsp";
        }
        return "/relogin";
    }
    @RequestMapping(value = {"/relogin","/"})
//    @ResponseBody
    public String reloginindex(){
        return "/login.jsp";
    }
    @RequestMapping("/ll")
    @ResponseBody
    public String kk(){
        return "asdfafas";
    }
}
